/*
 * @Description: 字符数据注入（生产环境）
 * @Autor: HuiSir<273250950@qq.com>
 * @Date: 2024-02-06 14:49:17
 * @LastEditTime: 2024-09-03 22:43:29
 */
import { loading1, loading2 } from "./inc/loading.js"
import { proLinks as frontEndLinks } from "./inc/frontEndLinks.js"

export default {
  loading1,
  loading2,
  themeName: "Doubt",
  themeInfoLink: `<a href="//code.zuifengyun.com/">Doubt</a>`,
  phpStart: "<?php",
  phpEnd: "?>",
  getThemeUriPath: "<?php echo get_template_directory_uri(); ?>",
  getHeader: "<?php get_header(); ?>",
  getBlogName: "<?php bloginfo('name'); ?>",
  getLogoLink: /* html */ `<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>`,
  getPosts: include("posts.php"),
  getFooter: "<?php get_footer(); ?>",
  getComments: include("comments.php"),
  wpHead: "<?php wp_head(); ?>",
  wpFooter: "<?php wp_footer(); ?>",
  isArchive: "<?php if (is_archive() || is_home() || is_search() || is_category() || is_author() || is_day() || is_year() || is_month()) { ?>",
  isSingular: "<?php if (is_singular()) { ?>",
  isSingularCss: "<?php if (is_singular() || is_404() || is_search()) { ?>",
  isSingle: "<?php if (is_single()) { ?>",
  isPage: "<?php if (is_page()) { ?>",
  closeTag: "<?php } ?>",
  archiveTitle: include("archive-title.php"),
  archiveDesc: include("archive-desc.php"),
  archivesByMonth: "<?php wphs_archives_list(); ?>",
  theTitle: "<?php the_title(); ?>",
  theID: "<?php the_ID(); ?>",
  theTime: "<?php the_time('Y-m-d') ?>",
  theContent: "<?php the_content(); ?>",
  thePermalink: "<?php the_permalink() ?>",
  tagsList: "<?php $tags_list = get_the_tag_list( '', __( '', 'theme_doubt' ) );if ( $tags_list ) :?><?php printf( __( '%1$s', 'theme_doubt' ), $tags_list ); ?><?php endif; ?>",
  archivesPostList: include("archives-post-list.php"),
  postsWhile: "<?php if (have_posts()) : while (have_posts()) : the_post(); ?>",
  endwhile: "<?php endwhile; ?>",
  endwhileElse: "<?php endwhile; else: ?>",
  endif: "<?php endif; ?>",
  ifHavePosts: "<?php if ( have_posts() ){ ?>",
  else: "<?php } else { ?>",
  postClassEntry: "<?php post_class(); ?>",
  articleArchivesDesc: tempDesc("文章归档"),
  frontEndDesc: tempDesc("前端知识归纳"),
  accountStoreDesc: tempDesc("账号仓库"),
  getCustomViews:
    "<?php if(function_exists('custom_the_views') ) custom_the_views($post->ID); ?>",
  editPostLink: "<?php edit_post_link( __( '[编辑]', '' )); ?>",
  theCategory: "<?php the_category(', ') ?>",
  getContentTempPart: "<?php get_template_part( 'content', get_post_format() ); ?>",
  getSearchParams: "<?php echo $s; ?>",
  getHeaderMenuTempPart: include("menu-header.php"),
  getFooterMenuTempPart: include("menu-footer.php"),
  getBlogroll: include("blogroll.php"), // 友情链接/声明
  getNotice: include("blogroll.php"),
  getBeianLink:
    /* html */`<?php if(theme_options('beian_record')){?><a target="_blank" href="http://www.miitbeian.gov.cn/"><?php echo theme_options('beian_record'); ?></a>&nbsp;·&nbsp;<?php } ?>`,
  getMobileQrcodeLink: include("mobile-qrcode.php"),
  setPageSeoInfo: "<?php include('seo.php'); ?>",
  articlePager: include("article-pager.php"),
  postsCount: `<?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish;?>`,
  commentsCount: `<?php echo $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments");?>`,
  lastUpdateTime: `<?php $last = $wpdb->get_results("SELECT MAX(post_modified) AS MAX_m FROM $wpdb->posts WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'private')");$last = date('Y年n月j日', strtotime($last[0]->MAX_m));echo $last; ?>`,
  frontEndLinks,
  accountStoreVersion: `<?php echo get_post_meta($post->ID, 'version', true); ?>`,
  accountStoreDownload1: `<?php echo get_post_meta($post->ID, 'download1', true); ?>`,
  accountStoreDownload2: `<?php echo get_post_meta($post->ID, 'download2', true); ?>`,
  accountStoreDownload3: `<?php echo get_post_meta($post->ID, 'download3', true); ?>`,
  accountStorePic1: `<?php echo get_post_meta($post->ID, 'pic1', true); ?>`,
  accountStorePic2: `<?php echo get_post_meta($post->ID, 'pic2', true); ?>`,
  accountStorePic3: `<?php echo get_post_meta($post->ID, 'pic3', true); ?>`,
}

function include (fileName) {
  return `<?php include('${fileName}'); ?>`
}

function tempDesc (tempName) {
  return `<?php	
      /* 
        Template Name: ${tempName}
      */
    ?>`
}
